import request from '@/utils/request'

//企服分类
export function GetenterpriseHelpCategory(data) {
	return new Promise((resolve, reject) => {
		request({
			url: '/enterpriseHelpCategory/list',
			method: 'get',
			data
		}).then(data => {
			resolve(data)
		}).catch((e) => {
			uni.showToast({
				title: e.msg,
				icon: 'none',
				duration: 2000
			})
			reject(e)
		})
	})
}
//企服分类详情
export function GetenterpriseHelpCategoryId(data) {
	return new Promise((resolve, reject) => {
		request({
			url: '/enterpriseHelpCategory/getById',
			method: 'get',
			data
		}).then(data => {
			resolve(data)
		}).catch((e) => {
			uni.showToast({
				title: e.msg,
				icon: 'none',
				duration: 2000
			})
			reject(e)
		})
	})
}
//企服列表
export function GetenterpriseHelpList(data) {
	return new Promise((resolve, reject) => {
		request({
			url: '/enterpriseHelp/list',
			method: 'get',
			data
		}).then(data => {
			resolve(data)
		}).catch((e) => {
			uni.showToast({
				title: e.msg,
				icon: 'none',
				duration: 2000
			})
			reject(e)
		})
	})
}
//企服详情
export function GetenterpriseId(data) {
	return new Promise((resolve, reject) => {
		request({
			url: '/enterpriseHelp/getById',
			method: 'get',
			data
		}).then(data => {
			resolve(data)
		}).catch((e) => {
			uni.showToast({
				title: e.msg,
				icon: 'none',
				duration: 2000
			})
			reject(e)
		})
	})
}

//申请
export function signUp(data) {
	return new Promise((resolve, reject) => {
		request({
			url: '/activity/applicationSave',
			method: 'post',
			data
		}).then(data => {
			resolve(data)
		}).catch((e) => {
			uni.showToast({
				title: e.msg,
				icon: 'none',
				duration: 2000
			})
			reject(e)
		})
	})
}